﻿/* START CONFIG */ 
var nicImageOptions = { 
buttons : { 
'image' : {name : 'Add Image', type : 'nicImageButton', tags : ['IMG']} 
} 
}; 
/* END CONFIG */ 
var nicImageButtonUpImage = nicEditorAdvancedButton.extend({ 
addPane : function() { 
this.im = this.ne.selectedInstance.selElm().parentTag('IMG'); 
this.addForm({ 
'' : {type : 'title', txt : '上传图片'}, 
'src' : {type : 'file', txt : '浏览文件', 'value' : 'http://', style : {width: '150px'}}
},this.im); 
}, 
submit : function(e) { 
var src = this.inputs['src'].value; 
alert(e)
if(src == "" || src == "http://") { 
alert("You must enter a Image URL to insert"); 
return false; 
} 
this.removePane(); 
if(!this.im) { 
var tmp = 'javascript:nicImTemp();'; 
this.ne.nicCommand("insertImage",tmp); 
this.im = this.findElm('IMG','src',tmp); 
} 
if(this.im) { 
this.im.setAttributes({ 
src : this.inputs['src'].value, 
alt : this.inputs['alt'].value, 
align : this.inputs['align'].value 
}); 
} 
} 
}); 
nicEditors.registerPlugin(nicPlugin,nicImageOptions); 
/* START CONFIG *//* END CONFIG */ 